package com.tt.plat8.commons.ui;

import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.themes.BaseTheme;

import java.awt.*;

public final class Buttons {

	private Buttons() {

	}

	public static Component newButtonsBar(Button... buttons) {
		HorizontalLayout bar = new HorizontalLayout();
		bar.setSpacing(true);
		for (Button button : buttons) {
			bar.addComponent(button);
		}
		return bar;
	}

	public static Button newLinkButton(String caption, boolean enabled) {
		Button button = new Button(caption);
		button.setStyleName(BaseTheme.BUTTON_LINK);
		button.setEnabled(enabled);
		return button;
	}

	public static Button newLinkButton(String caption) {
		return newLinkButton(caption, true);
	}

}
